package com.ruoyi.common.utils;

import com.alibaba.fastjson.JSONArray;
import com.ruoyi.common.core.domain.BrokerageDto;

import java.util.List;

public class BrokerageUtil {
    public static BrokerageDto getByCurrency(String amountJsonArray, String currency) {
        List<BrokerageDto> amountDtos = JSONArray.parseArray(amountJsonArray, BrokerageDto.class);
        for (BrokerageDto brokerageDto : amountDtos) {
            if (brokerageDto.getCurrency().equals(currency)) {
                return brokerageDto;
            }
        }

        return null;
    }
}
